#ifndef __UVSTRING_H
#define __UVSTRING_H

#include <string>

namespace uv {
namespace string {

/**
 * Tests if two strings are equal.
 *
 * @param str1 The first string in the comparison.
 * @param str2 The second string in the comparison.
 * @param case_sensitive Tells if the comparison should be case sensitive.
 *            Default value is true.
 * @return True if the two strings are equal.
 */
bool streq(const std::string& str1, const std::string& str2,
        const bool &case_sensitive = true);

/**
 * Get the boolean value represented in a string. This function is case
 * insensitive and accepts the following strings:
 * <ul>
 *   <li>true: "true" or "1".</li>
 *   <li>false: "false" or "0".</li>
 * </ul>
 *
 * @param str The string to be parsed for a boolean value.
 * @param val The resulting value of the parsing.
 * @return True if the parsing was successful.
 */
bool getBool(const std::string &str, bool& val);

/**
 * Tells if a string is numeric. Valid inputs can start with +/- and/or case
 * insensitive 0x for hex values.
 *
 * @param str The string to be parsed for numeric value.
 * @return True if the string can be parsed with stdlib functions such as
 *             strtol.
 */
bool isNumeric(const std::string &str);

} // namespace string
} // namespace uv

#endif // __UVSTRING_H
